﻿using System;
using System.Collections.Generic;
using System.Drawing.Design;
using System.Linq;
using System.Text;

namespace MainProGrid
{
    public class EventEditor : UITypeEditor  
    {
        public CustomEvent CustomEvent { get; set; }
        public EventEditor(CustomEvent CustomEvent) 
        {
            this.CustomEvent = CustomEvent;
        }
        public override UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
        {
            return UITypeEditorEditStyle.Modal;
        }
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            EventEditorFrm eef = new EventEditorFrm(this.CustomEvent);
            eef.ShowDialog();
            return eef.Value;
        }
    }
}
